home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
nn.zip
/
DATA.H
< prev
next >
Wrap
C/C++ Source or Header
|
1989-12-31
|
5KB
|
160 lines
/*
* Internal representation of the master, group, and article
* information read from the database.
*
* For each article read from the database, an article_header
* structure is initialized.
*/
/*
* global master data
*/
typedef struct {
time_t last_scan; /* age of active file at last scan */
group_number number_of_groups;
off_t next_group_write_offset; /* in .groups */
int free_groups; /* allocated during first visit */
} master_header;
/*
* group information
*/
typedef struct group_header {
/* this part of the header is read from */
/* the .master file */
article_number first_l_article;
article_number last_l_article;
off_t index_write_offset;
off_t data_write_offset;
int group_name_length;
int32 group_flag;
#ifdef I286_BUG
# define MF(n) (1L<<(n-1))
# define CF(n) (1L<<(n+15))
#else
# define MF(n) (((int32)1)<<(n-1))
# define CF(n) (((int32)1)<<(n+15))
#endif
# define G_MASTER_FLAGS (MF(17)-1) /* flags that are saved on file */
/* master flags */
# define G_MODERATED MF(1) /* group is moderated */
# define G_CONTROL MF(2) /* group is control group */
# define G_NO_DIRECTORY MF(3) /* group directory not found */
# define G_ALWAYS_DIGEST MF(4) /* always decode articles as digests */
# define G_NEVER_DIGEST MF(5) /* never decode articles as digests */
# define G_EXPIRE MF(6) /* expire in progress or pending */
# define G_BLOCKED MF(7) /* don't trust this entry */
/* client flags */
# define G_SUBSCRIPTION CF(1) /* from .rc */
# define G_READ CF(2) /* group has been read */
# define G_DONE CF(4) /* finished with this group */
# define G_NEW CF(5) /* new group */
# define G_FOLDER CF(6) /* "group" is a folder file */
# define G_DIRECTORY CF(7) /* "group" is directory */
# define G_SELECTION CF(8) /* a selection exist (use it) */
# define G_UNREAD_COUNT CF(9) /* is included in unread_articles */
# define G_MAILBOX CF(10) /* user's mail box file */
/* this part is initialized during reading of the .groups file */
/* DO NOT CHANGE THE POSITION OF group_num AS THE FIRST FIELD */
/* AFTER THE PART WHICH IS SAVED IN THE MASTER FILE */
group_number group_num;
group_number preseq_index;
char * group_name;
/* this part is used by the master to hold active file data */
/* and the reader to hold information from the .rc file */
article_number first_article;
article_number last_article;
struct group_header *next_group; /* group sequence */
struct group_header *prev_group;
char *kill_list;
char *save_file; /* default save file from init */
char *enter_macro;
off_t rc_offset; /* offset in rc_file */
} group_header;
/* size of the part of the group header placed on backing storage */
#define SAVED_GROUP_HEADER_SIZE(group) \
(((char *)(&((group).group_num))) - ((char *)(&(group))))
/*
* Internal article header information.
*/
typedef struct {
union {
article_number au_number; /* article number in the group */
char *au_string;
} au_union;
/* indexes to header line text */
off_t hpos; /* first byte of header */
off_t fpos; /* first byte in article text */
off_t lpos; /* last pos of article */
time_stamp t_stamp; /* encoded time_stamp */
char * sender; /* sender's name */
char * subject; /* subject (w/o Re:) */
int16 replies; /* no of Re: */
int16 lines; /* no of lines */
int8 subj_length; /* length of subject */
int8 name_length; /* length of sender */
group_header *a_group; /* if merged article menu */
int32 flag; /* flags: */
# define AF(n) (((int32)1)<<(n-1))
# define A_SELECT AF(1) /* article has been selected */
# define A_SAME AF(2) /* same subject as prev. article */
# define A_DIGEST AF(3) /* digest sub article */
# define A_FULL_DIGEST AF(4) /* full digest */
# define A_FAKED AF(5) /* only 'number' is valid */
# define A_FOLDER AF(6) /* article file = "folder_path" */
# define A_CANCEL AF(7) /* folder entry cancelled */
# define A_SEEN AF(8) /* article presented on menu */
# define A_KILL AF(9) /* eliminate article */
# define A_AUTO AF(10) /* article was auto selected */
# define A_READ AF(11) /* article has been read */
# define A_LEAVE AF(12) /* marked for later activity */
# define A_LEAVE_NEXT AF(13) /* marked for next invokation */
# define A_ST_FILED AF(16) /* articles is saved */
# define A_ST_REPLY AF(17) /* sent reply to article */
# define A_ST_FOLLOW AF(18) /* sent followup to article */
} article_header;
#define a_number au_union.au_number
#define a_string au_union.au_string